import { Controller, Get } from "@nestjs/common";
import { ModuleRefService } from "./module-ref.service";
import type { AsyncConfig } from "src/providers/async.config";
import { Public } from "src/decorators/is-public.decorator";
import { UserDto } from "src/business/users/interfaces/user.dto";

@Controller('/module-ref')
export class ModuleRefController {

    constructor(private moduleRefService: ModuleRefService) { }

    @Public()
    @Get('/service')
    async getUsers(): Promise<UserDto[]> {
         return await this.moduleRefService.getUsers();
    }

    @Public()
    @Get('/provider')
    async getConfigProvider(): Promise<AsyncConfig> {
        return await this.moduleRefService.getConfigProvider();
    }
}